how to reverse a list in python

34

a = [1,2,3,4]
a = a[::-1]
print(a)
>>> [4,3,2,1]

Comments

Submit
0 Comments